def run(params:list[str]):
    from ApiTools import apiTools,apiBase
    try:
        tab_name=apiBase.argv(params,1,'ept_sql_convert')
        vct_tool=apiBase.argv(params,2,'sql-convert/tools')
        grp = apiTools.load_grp()
        edges=grp.load_record(tab_name)
        agent=grp.load_json([vct_tool],edges)
        return apiBase.agent_reg(tab_name,agent)
        # code='select * from Project where "ProjectID" >0'
        # quest={}
        # quest["output"]={"messages": [("user", code)]}
        # quest['error']=None
        # quest['curNodeName']='__start__'
        # ret=agent.invoke({"aggregate": [quest], "curNodeName": quest['curNodeName'],"output":"","score":""})
        # import json
        # val=json.dumps(ret,ensure_ascii=False)
        # print(val)
    except Exception as e:
        return f"function error:{e}"
    
#准备测试例子
run([])